{% extends 'home/template.html' %}
{% load i18n %}

{% block title %} {% translate "User Add" %} {% endblock title %}

{% block content %}

    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1>{% translate "Add User" %}</h1>
          </div>
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="/">{% translate "Home" %}</a></li>
            </ol>
          </div>
        </div>
      </div>
    </section>


<section class="content">
    <div class="container-fluid">
      <div class="row">
        <div class="col-md-12">

            <div class="card card-outline card-primary">
              <div class="card-header">
                <h3 class="card-title">{% translate "User details" %}</h3>
              </div>

                  <form role="form" method="post" enctype="multipart/form-data">
                    {% csrf_token %}

                    <div class="card-body">
                    {% for field in form %}

                        <div class="form-group row">
                          <label class="col-sm-2 col-form-label">{{ field.label_tag }} </label>
                            <div class="col-md-10 col-sm-10 col-xs-12">
                              {{ field }}
                            </div>

                            {% if field.help_text %}
                              <small style="color: grey">{{ field.help_text }}</small>
                            {% endif %}

                            {% for error in field.errors %}
                              <p style="color: red">{{ error }}</p>
                              <br>
                            {% endfor %}

                        </div>

                {% endfor %}

                  </div>

                <div class="card-footer">
                  <button type="submit" class="btn btn-primary">{% translate "Save User" %}</button>
                </div>
              </form>

          </div>

        </div>
      </div>
    </div>
</section>



{% endblock %}

